<template>
	<view>
		<view class="float-main" v-if="floatShow">
			<view class="iconfont icon-shanchu c_ccc " @click="floatShow = false"></view>
			<image src="@/static/test.png" mode="aspectFit" @click="openObj"></image>
			
		</view>
	</view>
</template>

<script>
	import Api from '@/api/home.js'
	export default{
		data(){
			return{
				floatShow:true,
				cliType:1
			}
		},
		onLoad() {
			console.log(46546)
			this.getDetail()
		},
		methods:{
			getDetail(){
				Api.homefloating()
				.then(result => {
					console.log(result)
				})
			},
			openObj(){
				if(this.cliType === 1){
					// uni.prev
					uni.previewImage({
						urls:['https://www.tuantuanshou.com/static/home/images/banner.png']
					})
				}else if(this.cliType === 2){
					uni.navigateTo({
						url:'/pages/user/common_share'
					})
				}else{
					this.$toast('请联系客服')
					return
				}
			}
		},
		
	}
</script>

<style lang="scss">
	.float-main{
		position: fixed;
		right: 10rpx;
		bottom: 200rpx;
		text-align: right;
	}
	.float-main image{
		width: 150rpx;
		// margin-top: 40rpx;
		height: 150rpx;
	}
	.float-main .iconfont{
		font-size: 32rpx;
	}
</style>